<style>
.operationlist *{
font-size:12px !important;
}
.operationlist .ui-icon-comment{
font-size:18px !important;
    position: relative;
    top: 0px !important;
}
.ans-footer-comment .comments-list *,.ans-footer-comment input,.ans-footer-comment button{
font-size:13px !important;
}
</style>
     <div class="operationlist">
        {if $question['status']!=9&&$question['status']!=0}
                      <span onclick="show_comment('{$answer['id']}');">
                     <i class="ui-icon-comment"></i>
                                <span class="ans-comment-num">
                                    {$answer['comments']}条评论
                                </span>
                    </span>
                               {if 1==$user['grouptype'] ||$user['uid']==$question['authorid'] }
                        {if $question['status']==1}
                        <span onclick="adoptanswer($answer['id'])"><svg t="1607420036071" style="width:12px;height:12px;position:relative;top:2px;" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4058" width="200" height="200"><path d="M513.559007 60.225663c-248.299109 0-449.587532 201.299679-449.587532 449.625394 0 248.296039 201.288422 449.594695 449.587532 449.594695 248.27762 0 449.63358-201.299679 449.63358-449.594695C963.192587 261.525342 761.836627 60.225663 513.559007 60.225663zM513.678734 917.673369c-225.174436 0-407.703609-182.53736-407.703609-407.706679S288.505321 102.254895 513.678734 102.254895c225.165226 0 407.695423 182.541453 407.695423 407.710772S738.844983 917.673369 513.678734 917.673369z" p-id="4059" fill="#8590A6"></path><path d="M486.287897 644.807748c12.999059 12.790304 12.777001 34.097586-0.497327 47.590901l0 0c-13.275351 13.491269-34.577516 14.063297-47.576575 1.277086L282.51591 540.491914c-12.999059-12.791327-12.775978-34.097586 0.49835-47.590901l0 0c13.281491-13.494339 34.58468-14.06739 47.576575-1.276063L486.287897 644.807748z" p-id="4060" fill="#8590A6"></path><path d="M717.467093 359.167173c12.797467-12.999059 34.100656-12.771885 47.591925 0.502443l0 0c13.496385 13.274328 14.07046 34.573423 1.279133 47.576575L484.90541 693.291996c-12.791327 13.003152-34.093493 12.774955-47.583738-0.49835l0 0c-13.497409-13.278421-14.07046-34.577516-1.280156-47.576575L717.467093 359.167173z" p-id="4061" fill="#8590A6"></path></svg>采纳</span>
                        {/if}
                           <a href="{url answer/append/$question['id']/$answer['id']}"  ><i class="fa fa-edit"></i> <span>继续追问</span></a>
                       {/if}
                      
                                     <!--{if  1==$user['grouptype'] ||$user['uid']==$answer['authorid']}-->

                       <a href="{url answer/append/$question['id']/$answer['id']}"  ><i class="fa fa-edit"></i> <span>继续回答</span></a>

               <a href="{url question/editanswer/$answer['id']}"  ><i class="fa fa-edit"></i> <span>编辑</span></a>
                <span  onclick="deleteanswer($answer['id'])">删除</span>
                 <!--{/if}-->
                {/if}
             
                                      
          
                    </div>
                    
<div class="ui-dialog" id="dialogadopt">
    <div class="ui-dialog-cnt">
      <header class="ui-dialog-hd ui-border-b">
                  <h3>采纳回答</h3>
                  <i class="ui-dialog-close" data-role="button"></i>
              </header>

        <div class="ui-dialog-bd">


        <input type="hidden"  value="{$qid}" id="adopt_qid" name="qid"/>
        <input type="hidden" id="adopt_answer" value="0" name="aid"/>
        <table  class="table ">
            <tr valign="top">
                <td class="small_text">向帮助了您的网友说句感谢的话吧!</td>
            </tr>
            <tr>
                <td>
                    <div class="inputbox mt15">
                        <textarea class="adopt_textarea" id="adopt_txtcontent"  name="content">非常感谢!</textarea>
                    </div>
                </td>
            </tr>

        </table>

            <button  id="adoptbtn"  class="ui-btn ui-btn-primary">
       采纳
    </button>


        </div>


    </div>
</div>
               
                 <script type="text/javascript">
									var current_aid={$answer['id']};
									var adoptsubmit=false;

									$("#adoptbtn").click(function(){
										var _adopt_txtcontent=$.trim($("#adopt_txtcontent").val());
										if(_adopt_txtcontent==''){
											alert("采纳回复不能为空!");
											return false;
										}
										  var data={
									    			content:_adopt_txtcontent,
									    			qid:$("#adopt_qid").val(),
									    			aid:$("#adopt_answer").val()

									    	}
											if(adoptsubmit==true){
												
												return false;
											}

										  adoptsubmit=true;
										$.ajax({
										    //提交数据的类型 POST GET
										    type:"POST",
										    //提交的网址
										    url:"{SITE_URL}index.php?question/ajaxadopt",
										    //提交的数据
										    data:data,
										    //返回数据的格式
										    datatype: "json",//"xml", "html", "script", "json", "jsonp", "text".
										    //在请求之前调用的函数
										    beforeSend:function(){},
										    //成功返回之后调用的函数
										    success:function(data){
										    	var data=eval("("+data+")");
										       if(data.message=='ok'){
										    	   $("#adoptbtn").attr("disabled",true);
										    	   adoptsubmit=true;
										    	   alert("采纳成功!");

										    	   setTimeout(function(){
										               window.location.reload();
										           },1500);
										       }else{
										    	   adoptsubmit=false;
										    	   alert(data.message);

										       }


										    }   ,
										    //调用执行后调用的函数
										    complete: function(XMLHttpRequest, textStatus){

										    },
										    //调用出错执行的函数
										    error: function(){
										    	 adoptsubmit=false;
										        //请求出错处理
										    }
										 });
									})
									function adoptanswer(_aid) {

									    $("#adopt_answer").val(_aid);
									    $('.ui-actionsheet').removeClass('show').addClass('hide');
									    $('#dialogadopt').dialog('show');
									}
								
									function deleteanswer(_aid){
										if(confirm("确定删除回答吗?")){
											window.location.href=g_site_url + "index.php" + query + "question/deleteanswer/"+_aid+"/$qid";

										}
										
									}

</script>					